<?php
/**
 * Flea Site
 *
 * @copyright  Copyright (c) 2008 Movoin Studio (http://movoin.com)
 * @license    Apache License 2.0
 * @version    $Id: Order.php 134 2009-05-24 09:48:43Z movoin $
 */

/**
 * Controller_Order “产品订购”控制器
 *
 * @package Site
 * @subpackage Front
 *
 */

//{{include
FLEA::loadClass('Controller_Base');
//}}

class Controller_Order extends Controller_Base
{
    var $modelFeedback;

    /**
     * 构造函数
     *
     * @return Controller_Order
     */
    function Controller_Order()
    {
        // 构造父类
        parent::Controller_Base();
        $this->modelFeedback =& FLEA::getSingleton( 'Model_Feedback' );
    }

    /**
     * 显示控制台
     *
     */
    function actionIndex()
    {
        $this->_executeView('order');
    }

    function actionSend()
    {
        foreach($_POST as $p) {
            if(!$p) {
                js_alert('请填写完整的订购表单!', 'history.back(-1)');
            }
        }
        js_alert($this->modelFeedback->saveFeedback(&$_POST, 'order'), 0, url('order'));
    }

}
